kFilesContentsFigures, Tables, and ListingsAbout This BookFormat of a Typical ChapterConventions Used in This Book
Special FontsTypes of NotesAssembly-Language InformationDevelopment Environment Introduction to
File ManagementAbout Files
File Forks!The two forks of a Macintosh file File Size$Logical blocks and allocation blocks,Logical end-of-file and physical end-of-fileFile Access CharacteristicsThe Hierarchical File System&The Macintosh hierarchical file systemThe disk switch dialog box!Identifying Files and DirectoriesUsing FilesA typical File menuHandling the File menu commands$Testing for File Management RoutinesGTesting for the availability of routines that operate on FSSpec recordsDefining a Document RecordA sample document recordCreating a New FileHandling the New menu commandCreating a new document windowOpening a FileHandling the Open menu commandThe default Open dialog boxOpening a fileReading File DataReading data from a fileWriting File DataWriting data into a fileUpdating a file safely
Saving a FileHandling the Save menu command!Handling the Save As menu commandThe default Save dialog boxThe new folder dialog boxThe name conflict dialog box4Copying a resource from one resource fork to anotherReverting to a Saved FileA Revert to Saved dialog box)Handling the Revert to Saved menu commandClosing a FileHandling the Close menu commandClosing a file)Opening Files at Application Startup Time(Opening files at application launch timeUsing a Preferences FileOpening a preferences fileAdjusting the File MenuAdjusting the File menuFile Management ReferenceData Structures File System Specification RecordStandard File Reply RecordsApplication Files RecordsFile Specification RoutinesFile Access Routines#Reading, Writing, and Closing FilesManipulating the File MarkManipulating the End-of-File(File and Directory Manipulation Routines%Opening, Creating, and Deleting Files Exchanging the Data in Two Files#Creating File System SpecificationsVolume Access RoutinesUpdating VolumesObtaining Volume Information Application Launch File RoutinesSummary of File ManagementFile ManagerAbout the File ManagerFile ManipulationRoutines for opening file forks)Routines for operating on open file forks&Routines for operating on closed filesDirectory Manipulation%Routines for operating on directories-Routines for manipulating working directoriesVolume Manipulation!Routines for operating on volumesVolume Searching-Routines for manipulating working directoriesShared EnvironmentsShared environment routinesShared File Access Permissions$Access and deny mode synchronizationAccess mode translationDirectory Access Privileges5Access privileges information in the ioACAccess fieldRemote Volume Mounting-Privilege Information in Foreign File SystemsFile ID Reference Routines+Identifying Files, Directories, and VolumesFile System SpecificationsFile IDs
Directory IDsVolume Reference Numbers#Working Directory Reference NumbersNames and PathnamesHFS SpecificationsIdentifying a file in HFSSearch PathsUsing the File Manager,Determining the Features of the File ManagerTesting for PBCatSearch*Creating File System Specification Records*How FSMakeFSSpec interprets its parameters-Manipulating the Default Volume and DirectoryDeleting Files and File ForksDeleting a file’s resource forkSearching a Volume9Fields in ioSearchInfo1 and ioSearchInfo2 used for a file>Fields in ioSearchInfo1 and ioSearchInfo2 used for a directory#Searching a volume with PBCatSearch4Searching a volume using a recursive, indexed searchConstructing Full Pathnames(Constructing the full pathname of a file0Determining the Amount of Free Space on a Volume0Determining the amount of free space on a volumeSharing Volumes and Directories(Determining whether a volume is sharable+Determining whether file sharing is enabled!Locking and Unlocking File Ranges1Determining whether a file can have ranges locked/Locking a file range to append data to the fileData Organization on VolumesDisk and Volume Organization$Organization of partitions on a diskOrganization of a volumeBoot BlocksMaster Directory BlocksVolume BitmapsB*-TreesThe structure of a B*-tree fileNodesThe structure of a nodeNode Records"Structure of a B*-tree node recordA sample B*-treeHeader NodesHeader node structure Map NodesIndex Nodes
Leaf Nodes
Catalog FilesCatalog File KeysCatalog File Data RecordsExtents Overflow FilesData Organization in MemoryThe File I/O QueueVolume Control BlocksFile Control BlocksB*-Tree Control BlocksThe Drive Queue*Reading a drive queue element’s flag bytesFile Manager ReferenceData Structures File System Specification Record"Basic File Manager Parameter BlockHFS Parameter Block$Catalog Information Parameter BlocksCatalog Position RecordsCatalog Move Parameter Blocks"Working Directory Parameter Blocks#File Control Block Parameter BlocksVolume Attributes Buffer#Volume Mounting Information RecordsHigh-Level File Access Routines#Reading, Writing, and Closing FilesManipulating the File MarkManipulating the End-of-FileAllocating File BlocksLow-Level File Access Routines#Reading, Writing, and Closing FilesManipulating the File MarkManipulating the End-of-FileAllocating File BlocksUpdating Files!High-Level Volume Access RoutinesUnmounting VolumesUpdating VolumesManipulating the Default VolumeObtaining Volume Information Low-Level Volume Access RoutinesMounting and Unmounting VolumesUpdating VolumesObtaining Volume InformationManipulating the Default Volume"File System Specification Routines
Opening Files+Creating and Deleting Files and Directories1Accessing Information About Files and DirectoriesMoving Files or Directories Exchanging the Data in Two Files#Creating File System SpecificationsHigh-Level HFS Routines
Opening Files+Creating and Deleting Files and Directories1Accessing Information About Files and DirectoriesMoving Files or DirectoriesMaintaining Working DirectoriesLow-Level HFS Routines
Opening Files+Creating and Deleting Files and Directories1Accessing Information About Files and DirectoriesMoving Files or DirectoriesMaintaining Working DirectoriesSearching a Catalog Exchanging the Data in Two FilesShared Environment Routines"Opening Files While Denying Access!Locking and Unlocking File RangesManipulating Share PointsControlling Directory AccessMounting VolumesControlling Login AccessCopying and Moving FilesFile ID RoutinesResolving File ID References(Creating and Deleting File ID ReferencesForeign File System RoutinesUtility RoutinesObtaining Queue HeadersAdding a Drive(Obtaining File Control Block InformationApplication-Defined RoutinesCompletion RoutinesSummary of the File ManagerStandard File PackageAbout the Standard File PackageStandard User Interfaces
Opening FilesThe default Open dialog boxSaving FilesThe default Save dialog boxThe New Folder dialog boxThe name conflict dialog boxKeyboard EquivalentsCustomized User InterfacesSaving Files1The Save dialog box customized with radio buttons1The Save dialog box customized with a pop-up menu
Opening Files1The Open dialog box customized with a pop-up menu!Selecting Volumes and Directories@The Open dialog box customized to allow selection of a directory1The Open dialog box when no directory is selected:The Open dialog box with a long directory name abbreviatedA volume selection dialog boxUser Interface GuidelinesUsing the Standard File Package&Presenting the Standard User InterfaceHandling the Open menu command$Specifying more than four file typesCustomizing the User Interface'Presenting a customized Open dialog boxCustomizing Dialog Boxes-The definition of the default Open dialog box-The definition of the default Save dialog box-The item list for the default Open dialog box-The item list for the default Save dialog boxWriting a File Filter FunctionA sample file filter functionWriting a Dialog Hook FunctionA sample dialog hook function&Writing a Modal-Dialog Filter Function%A sample modal-dialog filter functionWriting an Activation ProcedureSetting the Current Directory!Determining the current directoryDetermining the current volumeSetting the current directorySetting the current volumeSetting the current directorySelecting a Directory2A file filter function that lists only directoriesSetting a button’s title>Handling user selections in the directory selection dialog box-Presenting the directory selection dialog boxSelecting a Volume.A file filter function that lists only volumes;Handling user selections in the volume selection dialog box*Presenting the volume selection dialog boxUsing the Original ProceduresStandard File Package ReferenceData Structures#Enhanced Standard File Reply Record#Original Standard File Reply RecordStandard File Package RoutinesSaving Files
Opening FilesApplication-Defined RoutinesFile Filter FunctionsDialog Hook FunctionsModal-Dialog Filter FunctionsActivation Procedures$Summary of the Standard File Package
Alias ManagerAbout the Alias Manager
Alias RecordsSearch StrategiesRelative SearchesResolving a relative pathAbsolute Searches
Fast SearchesExhaustive SearchesUsing the Alias ManagerCreating Alias RecordsCreating an alias recordResolving Alias RecordsIdentifying a Single TargetIdentifying Multiple TargetsMaintaining Alias Records%Storing an alias record as a resource&Getting Information From Alias RecordsCustomizing Alias RecordsAlias Manager ReferenceData Structures
Alias RecordsAlias Manager Routines#Creating and Updating Alias Records#Resolving and Reading Alias RecordsApplication-Defined RoutinesFiltering Possible TargetsSummary of the Alias ManagerDisk Initialization Manager%About the Disk Initialization ManagerDisk Initialization&The Disk Initialization User Interface"The disk initialization dialog box8Alternate buttons for the disk initialization dialog boxThe disk initialization warningThe disk naming dialog box$The Finder’s disk erasing dialog boxBad Block Sparing%Using the Disk Initialization Manager"Responding to Disk-Inserted Events"Responding to disk-inserted eventsErasing Initialized DisksReinitializing a valid disk0Overriding the Standard Initialization InterfaceLReinitializing a validly formatted disk without using the standard interfaceGInitializing an uninitialized disk without using the standard interface'Changing Default Volume Characteristics'Changing default volume characteristics%Disk Initialization Manager ReferenceRoutines5Loading and Unloading the Disk Initialization ManagerInitializing a Disk&Low-Level Disk Initialization Routines*Summary of the Disk Initialization ManagerGlossaryIndex